<!-- 个人中心 -->
<template>
	<view class="box">
		<view class="boxitem">
			<view class="title">收货人</view>
			<view class="boxinput"><input placeholder="请输入姓名" /></view>
		</view>
		<view class="boxitem">
			<view class="title">手机号码</view>
			<view class="boxinput"><input placeholder="请输入手机号" /></view>
		</view>
		<view class="boxitem">
			<view class="title">所在区域</view>
			<view class="boxinput">
				<picker mode="region" :value="regionValue" @change="bindRegionChange">
					<view>{{region}}</view>
				</picker>
			</view>
		</view>
		<view class="boxitem">
			<view class="title1">详细地址</view>
			<view class="boxinput"><input placeholder="小区楼栋、乡村名称" /></view>
			<view class="dz">选择地址</view>
		</view>
		<view class="boxitem">
			<view class="title2">设为默认地址</view>
			<view ><switch checked @change="switch1Change" /></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				regionValue: [],
				region: '省、市、区、街道'
			}
		},
		onLoad() {},
		onShow() {

		},
		computed: {

		},
		methods: {
			 switch1Change: function (e) {
			            console.log('switch1 发生 change 事件，携带值为', e.detail.value)
			        },
			bindRegionChange(e) {
				console.log(('e', e))
			if(e.detail.value.length>0){
					this.region = e.detail.value[0] + '-' + e.detail.value[1] + '-' + e.detail.value[2]
			}
			}
		},
	}
</script>

<style lang="scss" scoped>
	* {
		box-sizing: border-box;
		margin: 0;
		padding: 0;
	}

	.box {
		padding: 47rpx 70rpx 0rpx 47rpx;
	}

	.boxitem {
		display: flex;
		padding: 40rpx 0rpx 40rpx 0rpx;
		border-bottom: 1px solid #EEEEEE;
		align-items: center;
	}

	.title {
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #333333;
		width: 20%;
	}

	.boxinput {
		margin-left: 50rpx;
		width: 80%;
	}
	.title1 {
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #333333;
		width: 25%;
	}
	.title2 {
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #333333;
		flex: 1;
	}
	.dz{
		background-size: 100% 100%;
		width: 160rpx;
		height: 50rpx;
		background-image: url('/static/image/fenxiao80.png');
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #FFFFFF;
	}
</style>
